<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改员工信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-member-edit" th:object="${member}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">用户名称：</label>
            <div class="col-sm-8">
                <input name="username" th:field="*{username}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">角色：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('member_role')}">
                    <input type="radio" th:id="${'role_' + dict.dictCode}" name="role" th:value="${dict.dictValue}" th:field="*{role}">
                    <label th:for="${'role_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所属门店：</label>
            <div class="col-sm-8">
                <select name="dealerId" class="form-control m-b"  >
                    <option th:each="dict : ${dealerList}" th:text="${dict.name}" th:value="${dict.id}" th:field="*{dealerId}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">手机号：</label>
            <div class="col-sm-8">
                <input name="mobile" th:field="*{mobile}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">微信号：</label>
            <div class="col-sm-8">
                <input name="wechat" th:field="*{wechat}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">性别：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('member_sex')}">
                    <input type="radio" th:id="${'sex_' + dict.dictCode}" name="sex" th:value="${dict.dictValue}" th:field="*{sex}">
                    <label th:for="${'sex_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">账户状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('member_status')}">
                    <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                    <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">工号：</label>
            <div class="col-sm-8">
                <input name="memeberNo" th:field="*{memeberNo}" class="form-control" type="text">
            </div>
        </div>

    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "system/member";
    $("#form-member-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-member-edit').serialize());
        }
    }
</script>
</body>
</html>